<script type="text/javascript">
$('form input[type="submit"]').click(function(e){
	form = $(this).parent();
	e.preventDefault();
	$.ajax({
		type: 'POST',
		dataType: 'json',
		data: form.serializeArray(),
		url: form.attr('action'),
		success: function(data,status){
			if(data.status == 'sukses'){
				window.location.href = '<?php echo base_url().'dashboard' ?>';
			} else {
				$('#error_info').find('div').html(data.error);
				$('#error_info').show();
			}
		}
	});
});
</script>
